package kr.hkit.androidcomplete01.ch05;

import kr.hkit.androidcomplete01.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

public class RelativeNameCardEx extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.ch05_relativenamecardex);
		
		
		findViewById(R.id.btndel).setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				ImageView image = (ImageView) findViewById(R.id.picture);
				TextView tvName = (TextView) findViewById(R.id.name);
				TextView tvCall = (TextView) findViewById(R.id.call);
				TextView tvDes = (TextView) findViewById(R.id.description);
						
				if (image.getVisibility()==View.VISIBLE){
					image.setVisibility(View.GONE);
					tvName.setVisibility(View.GONE);
					tvCall.setVisibility(View.GONE);
					tvDes.setVisibility(View.GONE);
					
				} else {
					image.setVisibility(View.VISIBLE);
					tvName.setVisibility(View.VISIBLE);
					tvCall.setVisibility(View.VISIBLE);
					tvDes.setVisibility(View.VISIBLE);
				}
				
			}
		});
	}
}
